home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / src / gas-211 / gas / makefile < prev    next >
Encoding:
Makefile  |  1993-11-27  |  14.8 KB  |  482 lines

  1. # Makefile for GNU Assembler
  2. #   Copyright (C) 1987-1992 Free Software Foundation, Inc.
  3.  
  4. #This file is part of GNU GAS.
  5.  
  6. #GNU GAS is free software; you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation; either version 2, or (at your option)
  9. #any later version.
  10.  
  11. #GNU GAS is distributed in the hope that it will be useful,
  12. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. #GNU General Public License for more details.
  15.  
  16. #You should have received a copy of the GNU General Public License
  17. #along with GNU GAS; see the file COPYING.  If not, write to
  18. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # The targets for external use include:
  21. # all, doc, proto, install, uninstall, includes, TAGS,
  22. # clean, cleanconfig, realclean, stage1, stage2, stage3, stage4.
  23.  
  24. # Variables that exist for you to override.
  25. # See below for how to change them for certain systems.
  26.  
  27. srcdir = .
  28.  
  29. prefix = /usr/local
  30.  
  31. program_transform_name =
  32. exec_prefix = $(prefix)
  33. bindir = $(exec_prefix)/bin
  34. libdir = $(exec_prefix)/lib
  35. tooldir = $(libdir)/$(target_alias)
  36.  
  37. datadir = $(prefix)/lib
  38. mandir = $(prefix)/man
  39. man1dir = $(mandir)/man1
  40. man2dir = $(mandir)/man2
  41. man3dir = $(mandir)/man3
  42. man4dir = $(mandir)/man4
  43. man5dir = $(mandir)/man5
  44. man6dir = $(mandir)/man6
  45. man7dir = $(mandir)/man7
  46. man8dir = $(mandir)/man8
  47. man9dir = $(mandir)/man9
  48. infodir = $(prefix)/info
  49. includedir = $(prefix)/include
  50. docdir = $(datadir)/doc
  51.  
  52. VERSION=2.1
  53.  
  54. SHELL = /bin/sh
  55.  
  56. INSTALL = install -c
  57. INSTALL_PROGRAM = $(INSTALL)
  58. INSTALL_DATA = $(INSTALL)
  59.  
  60. AR = ar
  61. AR_FLAGS = qv
  62. BISON = bison
  63. MAKEINFO = makeinfo
  64. TEXI2DVI = texi2dvi
  65. RANLIB = ranlib
  66. CFLAGS = -g
  67.  
  68. AS_FOR_TARGET = $${here}/as.new
  69.  
  70. CC_FOR_TARGET = ` \
  71.   if [ -f $${here}/../gcc/Makefile ] ; then \
  72.     echo $${here}/../gcc/xgcc -B$${here}/../gcc/; \
  73.   else \
  74.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  75.       echo $(CC); \
  76.     else \
  77.       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
  78.     fi; \
  79.   fi`
  80.  
  81. NM_FOR_TARGET = ` \
  82.   if [ -f $${here}/../binutils/Makefile ] ; then \
  83.     echo $${here}/../binutils/nm ; \
  84.   else \
  85.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  86.       echo $(NM); \
  87.     else \
  88.        t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
  89.     fi; \
  90.   fi`
  91.  
  92. OBJDUMP=objdump
  93. OBJDUMP_FOR_TARGET = ` \
  94.   if [ -f $${here}/../binutils/Makefile ] ; then \
  95.     echo $${here}/../binutils/objdump ; \
  96.   else \
  97.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  98.       echo $(OBJDUMP); \
  99.     else \
  100.        t='$(program_transform_name)'; echo objdump | sed -e '' $$t ; \
  101.     fi; \
  102.   fi`
  103.  
  104. FLAGS_TO_PASS = \
  105.     "prefix=$(prefix)" \
  106.     "exec_prefix=$(exec_prefix)" \
  107.     "tooldir=$(tooldir)" \
  108.     "AR=$(AR)" \
  109.     "AR_FLAGS=$(AR_FLAGS)" \
  110.     "CC=$(CC)" \
  111.     "CFLAGS=$(CFLAGS)" \
  112.     "RANLIB=$(RANLIB)" \
  113.     "LOADLIBES=$(LOADLIBES)" \
  114.     "LDFLAGS=$(LDFLAGS)" \
  115.     "BISON=$(BISON)" \
  116.     "LEX=$(LEX)" \
  117.     "MAKEINFO=$(MAKEINFO)" \
  118.     "INSTALL=$(INSTALL)" \
  119.     "INSTALL_DATA=$(INSTALL_DATA)" \
  120.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
  121.  
  122. CHECKFLAGS= \
  123.     "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
  124.     "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  125.     "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  126.     "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)"
  127.  
  128. # Lists of files for various purposes.
  129.  
  130. REAL_SOURCES = \
  131.     $(srcdir)/app.c \
  132.     $(srcdir)/as.c \
  133.     $(srcdir)/atof-generic.c \
  134.     $(srcdir)/bignum-copy.c \
  135.     $(srcdir)/cond.c \
  136.     $(srcdir)/expr.c \
  137.     $(srcdir)/flonum-konst.c \
  138.     $(srcdir)/flonum-copy.c \
  139.     $(srcdir)/flonum-mult.c \
  140.     $(srcdir)/frags.c \
  141.     $(srcdir)/hash.c \
  142.     $(srcdir)/hex-value.c \
  143.     $(srcdir)/input-file.c \
  144.     $(srcdir)/input-scrub.c \
  145.     $(srcdir)/messages.c \
  146.     $(srcdir)/output-file.c \
  147.     $(srcdir)/read.c \
  148.     $(srcdir)/subsegs.c \
  149.     $(srcdir)/symbols.c \
  150.     $(srcdir)/write.c \
  151.     $(srcdir)/listing.c \
  152.     $(srcdir)/xmalloc.c
  153.  
  154. # in an expedient order
  155. LINKED_SOURCES = \
  156.     targ-cpu.c \
  157.     obj-format.c \
  158.     atof-targ.c
  159.  
  160. SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)
  161.  
  162. REAL_HEADERS = \
  163.     $(srcdir)/as.h \
  164.     $(srcdir)/bignum.h \
  165.     $(srcdir)/expr.h \
  166.     $(srcdir)/flonum.h \
  167.     $(srcdir)/frags.h \
  168.     $(srcdir)/hash.h \
  169.     $(srcdir)/input-file.h \
  170.     $(srcdir)/listing.h \
  171.     $(srcdir)/tc.h \
  172.     $(srcdir)/obj.h \
  173.     $(srcdir)/read.h \
  174.     $(srcdir)/struc-symbol.h \
  175.     $(srcdir)/subsegs.h \
  176.     $(srcdir)/symbols.h \
  177.     $(srcdir)/write.h
  178.  
  179. LINKED_HEADERS = \
  180.     a.out.gnu.h \
  181.     a.out.h \
  182.     host.h \
  183.     targ-env.h \
  184.     targ-cpu.h \
  185.     obj-format.h \
  186.     atof-targ.h
  187.  
  188. HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)
  189.  
  190. OBJS = \
  191.     targ-cpu.o \
  192.     obj-format.o \
  193.     atof-targ.o \
  194.     app.o \
  195.     as.o \
  196.     atof-generic.o \
  197.     bignum-copy.o \
  198.     cond.o \
  199.     expr.o \
  200.     flonum-konst.o \
  201.     flonum-copy.o \
  202.     flonum-mult.o \
  203.     frags.o \
  204.     hash.o \
  205.     hex-value.o \
  206.     input-file.o \
  207.     input-scrub.o \
  208.     messages.o \
  209.     output-file.o \
  210.     read.o \
  211.     subsegs.o \
  212.     symbols.o \
  213.     write.o \
  214.     listing.o \
  215.     xmalloc.o
  216.  
  217. TDEFINES=-DBFD_HEADERS -DMANY_SEGMENTS -DBFD -DI386COFF
  218. LOCAL_LOADLIBES=../bfd/libbfd.a
  219. #### host, target, and site specific Makefile frags come in here.
  220.  
  221. all: as.new
  222.     @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)
  223.  
  224. dvi info:
  225.     @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)
  226.  
  227. install-info:
  228.     @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) install-info)
  229.  
  230. clean-info:
  231.     @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean-info)
  232.  
  233. # Now figure out from those variables how to compile and link.
  234.  
  235. # This is the variable actually used when we compile.
  236. ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) \
  237.     $(BFDDEF)
  238.  
  239. # How to link with both our special library facilities
  240. # and the system's installed libraries.
  241.  
  242. LIBS = ../opcodes/libopcodes.a $(BFDLIB) $(LOCAL_LOADLIBES) \
  243.     ../libiberty/libiberty.a
  244.  
  245. # Specify the directories to be searched for header files.
  246. # Both . and srcdir are used, in that order,
  247. # so that tm.h and config.h will be found in the compilation
  248. # subdirectory rather than in the source directory.
  249. INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
  250. SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
  251.  
  252. # Always use -I$(srcdir)/config when compiling.
  253. .c.o:
  254.     $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
  255.  
  256. # This tells GNU make version 3 not to export all the variables
  257. # defined in this file into the environment.
  258. .NOEXPORT:
  259.  
  260. # Files to be copied away after each stage in building.
  261. STAGESTUFF = *.o as.new
  262.  
  263. as.new: $(OBJS) $(LIBS)
  264.     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
  265.  
  266. installcheck:
  267.     @echo No installcheck target is available yet for the GNU assembler.
  268.  
  269. check: as.new
  270.     @(here=`pwd` ; export here ; \
  271.       cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $(CHECKFLAGS) check)
  272.  
  273. config.status:
  274.     @echo You must configure gas.  Look at the INSTALL file for details.
  275.     @false
  276.  
  277. config-stamp: Makefile
  278.     -rm -f config.new config-stamp
  279.     echo '#define TARGET_CPU       "$(target_cpu)"'        > config.new
  280.     echo '#define TARGET_ALIAS     "$(target_alias)"'     >> config.new
  281.     echo '#define TARGET_CANONICAL "$(target_canonical)"' >> config.new
  282.     echo '#define GAS_VERSION      "$(VERSION)"'          >> config.new
  283.     $(srcdir)/../move-if-change config.new config.h
  284.     touch config-stamp
  285.  
  286. # Compiling object files from source files.
  287.  
  288. app.o : app.c as.h host.h targ-env.h obj-format.h \
  289.   targ-cpu.h struc-symbol.h \
  290.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
  291. as.o : as.c as.h host.h targ-env.h obj-format.h \
  292.   targ-cpu.h struc-symbol.h \
  293.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h subsegs.h \
  294.   tc.h obj.h config.h
  295. atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \
  296.   targ-cpu.h struc-symbol.h \
  297.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
  298. bignum-copy.o : bignum-copy.c as.h host.h \
  299.   targ-env.h obj-format.h \
  300.   targ-cpu.h struc-symbol.h \
  301.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
  302. cond.o : cond.c as.h host.h targ-env.h obj-format.h \
  303.   targ-cpu.h struc-symbol.h \
  304.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
  305.  
  306. debug.o : debug.c as.h host.h targ-env.h obj-format.h \
  307.   targ-cpu.h struc-symbol.h \
  308.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  309.   subsegs.h 
  310. expr.o : expr.c as.h host.h targ-env.h obj-format.h \
  311.   targ-cpu.h  struc-symbol.h \
  312.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
  313.  
  314. flonum-konst.o : flonum-konst.c flonum.h bignum.h 
  315. flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \
  316.   targ-cpu.h  struc-symbol.h \
  317.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
  318. flonum-mult.o : flonum-mult.c flonum.h bignum.h 
  319. frags.o : frags.c as.h host.h targ-env.h obj-format.h \
  320.   targ-cpu.h  struc-symbol.h \
  321.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  322.   subsegs.h  
  323. hash.o : hash.c as.h host.h targ-env.h obj-format.h \
  324.   targ-cpu.h  struc-symbol.h \
  325.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h 
  326. hex-value.o : hex-value.c 
  327. input-file.o : input-file.c as.h host.h \
  328.    targ-env.h obj-format.h targ-cpu.h \
  329.    struc-symbol.h write.h flonum.h bignum.h expr.h \
  330.   frags.h hash.h read.h symbols.h tc.h obj.h input-file.h 
  331. input-scrub.o : input-scrub.c   \
  332.   as.h host.h targ-env.h obj-format.h \
  333.   targ-cpu.h  struc-symbol.h \
  334.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  335.   input-file.h 
  336. listing.o : listing.c as.h host.h targ-env.h flonum.h bignum.h \
  337.   listing.h obj-format.h targ-cpu.h struc-symbol.h write.h expr.h \
  338.   frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
  339. messages.o : messages.c as.h host.h targ-env.h obj-format.h \
  340.   targ-cpu.h  struc-symbol.h \
  341.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
  342. output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \
  343.   targ-cpu.h  struc-symbol.h \
  344.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  345.   output-file.h 
  346. read.o : read.c as.h host.h targ-env.h obj-format.h \
  347.   targ-cpu.h  struc-symbol.h \
  348.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
  349. subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
  350.   targ-cpu.h  struc-symbol.h \
  351.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  352.   subsegs.h  
  353. symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
  354.   targ-cpu.h  struc-symbol.h \
  355.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  356.    subsegs.h 
  357. write.o : write.c as.h host.h targ-env.h obj-format.h \
  358.   targ-cpu.h  struc-symbol.h \
  359.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
  360.   subsegs.h  output-file.h 
  361. xmalloc.o : xmalloc.c
  362. atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
  363.   targ-cpu.h struc-symbol.h \
  364.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
  365.   symbols.h tc.h obj.h 
  366. obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
  367.   targ-cpu.h struc-symbol.h \
  368.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
  369.   subsegs.h symbols.h tc.h obj.h  
  370. targ-cpu.o : targ-cpu.c config.h targ-env.h obj-format.h \
  371.   targ-cpu.h struc-symbol.h \
  372.   write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
  373.   symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
  374.  
  375. # Remake the info files.
  376.  
  377. doc: $(srcdir)/as.info
  378.  
  379. $(srcdir)/as.info: $(srcdir)/doc/as.texinfo
  380.     @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)    
  381.  
  382. clean:
  383.     @(cd doc ; $(MAKE) $(FLAGS_TO_PASS) clean)
  384.     @(cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) clean)
  385.     -rm -f $(STAGESTUFF) core
  386.  
  387. # Like clean but also delete the links made to configure gas.
  388. distclean: clean
  389.     -rm -f config.status Makefile host.h targ-env.h targ-cpu.h \
  390.         targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS
  391.  
  392. # Entry points `install', `includes' and `uninstall'.
  393.  
  394. # Copy the files into directories where they will be run.
  395. install:
  396.     -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
  397.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  398.     -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
  399.     -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
  400.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  401.     -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
  402.     -n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
  403.     rm -f $(bindir)/$$n; \
  404.     $(INSTALL_PROGRAM) as.new $(bindir)/$$n; \
  405.     $(INSTALL_DATA) $(srcdir)/doc/as.1 $(man1dir)/$$n.1; \
  406.     if [ -d $(tooldir) ]; then \
  407.       if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
  408.       rm -f $(tooldir)/bin/as; \
  409.       ln $(bindir)/$$n $(tooldir)/bin/as \
  410.        || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
  411.     else true; fi
  412.  
  413. # Cancel installation by deleting the installed files.
  414. uninstall:
  415.     -n=`t='$(program_transform_name)'; echo as | sed -e "" $$t`; \
  416.     rm -f $(bindir)/$$n; \
  417.     rm -f $(mandir)/$$n.1
  418.  
  419. # These exist for maintenance purposes.
  420.  
  421. tags TAGS: force
  422.     etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in
  423.     
  424. bootstrap: as.new force
  425.     $(MAKE) stage1
  426.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
  427.     $(MAKE) stage2
  428.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
  429.     $(MAKE) comparison against=stage2
  430.  
  431. bootstrap2: force
  432.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
  433.     $(MAKE) stage2
  434.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
  435.     $(MAKE) comparison against=stage2
  436.  
  437. bootstrap3: force
  438.     $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new
  439.     $(MAKE) comparison against=stage2
  440.  
  441. # Copy the object files from a particular stage into a subdirectory.
  442. stage1: force
  443.     -mkdir stage1
  444.     -mv $(STAGESTUFF) stage1
  445.     if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi
  446.  
  447. stage2: force
  448.     -mkdir stage2
  449.     -mv $(STAGESTUFF) stage2
  450.     if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi
  451.  
  452. stage3: force
  453.     -mkdir stage3
  454.     -mv $(STAGESTUFF) stage3
  455.     if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi
  456.  
  457. against=stage2
  458.  
  459. comparison: force
  460.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  461.  
  462. de-stage1: force
  463.     - (cd stage1 ; rm as ; mv -f * ..)
  464.     - rmdir stage1
  465.  
  466. de-stage2: force
  467.     - (cd stage2 ; rm as ; mv -f * ..)
  468.     - rmdir stage2
  469.  
  470. de-stage3: force
  471.     - (cd stage3 ; rm as ; mv -f * ..)
  472.     - rmdir stage3
  473.  
  474. #In GNU Make, ignore whether `stage*' exists.
  475. .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
  476.  
  477. force:
  478.  
  479. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
  480.         $(srcdir)/configure.in
  481.     $(SHELL) ./config.status
  482.